import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;


public class BicycleTest {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void initialized() {
		Bicycle myBike = new Bicycle(18);
		
		int gearsFromFactory = myBike.getGears();
		
		assertTrue(gearsFromFactory == 18);
		
		int currentSpeed = myBike.getSpeed();
		assertTrue(currentSpeed == 0);
	}
	
	@Test
	public void startPedal() {
		Bicycle myBike = new Bicycle(18);
		
		myBike.pedal();
		
		int currentSpeed = myBike.getSpeed();
		
		assertTrue(currentSpeed == 1);
		
		myBike.pedal();		
		currentSpeed = myBike.getSpeed();
		assertTrue(currentSpeed == 2);

		myBike.pedal();
		currentSpeed = myBike.getSpeed();
		assertTrue(currentSpeed == 3);

		myBike.pedal();
		currentSpeed = myBike.getSpeed();
		assertTrue(currentSpeed == 4);
		
		myBike.brake();
		currentSpeed = myBike.getSpeed();
		assertTrue(currentSpeed == 3);


		
	}

}
